package me.shiqiang.im.statistics;

import java.util.concurrent.atomic.AtomicLong;

/**
 * Created by John on 2018/1/30
 */
public class MsgCount {
    private static MsgCount instance = new MsgCount();

    private MsgCount() {
    }

    public static MsgCount getInstance() {
        return instance;
    }

    private AtomicLong p2pMsgCount = new AtomicLong(0);

    private AtomicLong groupMsgCount = new AtomicLong(0);

    public void p2pIncrement(){
        p2pMsgCount.incrementAndGet();
    }

    public void resetP2pCount(){
        p2pMsgCount = new AtomicLong(0);
    }

    public void groupIncrement(){
        groupMsgCount.incrementAndGet();
    }

    public void resetGroupCount(){
        groupMsgCount = new AtomicLong(0);
    }

    public AtomicLong getP2pMsgCount() {
        return p2pMsgCount;
    }

    public AtomicLong getGroupMsgCount() {
        return groupMsgCount;
    }
}
